Skip to main content

Segmented Control

Type

widget

Summary

A widget that shows a row of selectable horizontal segments.

A segmented control is a horizontal control that is made up of multiple segments, where each segment functions as a discrete button. Each segment can either show a label or an icon.

One or more of the segments can be highlighted by clicking on them. By default, only one segment at a time can be highlighted, but it is possible to allow multiple segments to be highlighted.

The segmented control is great for:

  • displaying a set of different options in a settings window (for example, it is used to display text alignment in the LiveCode property inspector)
  • switching between different cards in a stack
  • displaying a set of toggleable settings

Description

A widget that shows a row of selectable horizontal segments.

A segmented control is a horizontal control that is made up of multiple segments, where each segment functions as a discrete button. Each segment can either show a label or an icon.

One or more of the segments can be highlighted by clicking on them. By default, only one segment at a time can be highlighted, but it is possible to allow multiple segments to be highlighted.

The segmented control is great for:

  • displaying a set of different options in a settings window (for example, it is used to display text alignment in the LiveCode property inspector)
  • switching between different cards in a stack
  • displaying a set of toggleable settings

property: itemLabels, itemIcons, hilitedItems, multipleHilites

Children Properties

Message

NameSummarySyntax
hiliteChangedSent when the hilite of the segmented control widget changeshiliteChanged

Property

NameSummarySyntax
foreColorThe default label or icon colorget the foreColor of <widget> set the foreColor of <widget> to <color>
backColorThe default background colorget the backColor of <widget> set the backColor of <widget> to <color>
hiliteColorThe background color of highlighted segmentsget the hiliteColor of <widget> set the hiliteColor of <widget> to <color>
borderColorThe border colorget the borderColor of <widget> set the borderColor of <widget> to <color>
itemLabelsThe labels displayed by each segmentget the itemLabels of <widget> set the itemLabels of <widget> to <labelList>
hilitedItemsThe currently highlighted segment indicesget the hilitedItems of <widget> set the hilitedItems of <widget> to <indexList>
itemEnabledWhether each segment is enabled or disabled.get the itemEnabled of <widget> set the itemEnabled of <widget> to <booleanList>
hilitedItemLabelsThe currently highlighted segment labelsget the hilitedItemLabels of <widget> set the hilitedItemLabels of <widget> to <labelsList>
multipleHilitesWhether multiple segments may be highlighted simultaneouslyget the multipleHilites of <widget> set the multipleHilites of <widget> to { true | false }
showBorderWhether the widget has a border or notget the showBorder of <widget> set the showBorder of <widget> to { true | false }
itemMinExtentsThe minimum width of each segmentget the itemMinExtents of <widget> set the itemMinExtents of <widget> to <numberList>
itemIconsThe icons displayed by each segmentget the itemIcons of <widget> set the itemIcons of <widget> to <iconNames>
hilitedItemIconsThe icons displayed by each segment when highlightedget the hilitedItemIcons of <widget> set the hilitedItemIcons of <widget> to <iconNames>
itemStyleThe segment display styleget the itemStyle of <widget> set the itemStyle of <widget> to <segmentStyle>
itemNamesThe names used to identify segmentsget the itemNames of <widget> set the itemNames of <widget> to <nameList>
toggleHilitesWhether a segment can be unhighlighted by clickingget the toggleHilites of <widget> set the toggleHilites of <widget> to {true | false}
hilitedItemNamesThe currently highlighted segment namesget the hilitedItemNames of <widget> set the hilitedItemNames of <widget> to <nameList>
rippleEffectWhether to show a ripple effect on user interaction or not.get the rippleEffect of <widget> set the rippleEffect of <widget> to <value>
horizontalWhether the segmented widget is horizontal or notget the horizontal of <widget> set the horizontal of <widget> to {true | false}
cornerRadiusThe corner radius of the widgetget the cornerRadius of <widget> set the cornerRadius of <widget> to <value>
itemCountThe number of segments shownget the itemCount of <widget> set the itemCount of <widget> to <number>
hilitedTextColorThe label or icon color for highlighted segmentsget the hilitedTextColor of <widget> set the hilitedTextColor of <widget> to <pColor>